<?php
/*
 * 用于弹出窗口 无HEADER FOOTER
 * 
 * */
class DialogController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
        
        $this->_helper->layout->setLayout('dialog');
    }
	
    //车源信息二维码
    public function erweimaAction()
    {
        // action body
        $cid = intval($this->_request->getParam('cid'));
        $sale = new Model_CarSale();
        $data = $sale->getViewName($cid);
        $core = new Model_Core();
        
        $chl = $data[0][title]."/价格:".$data[0][price]."/".$data[0][car_year]."年".$data[0][car_month]."月上牌/".$data[0][kilometer]."公里/".$data[0][pailiang].$data[0][biansuxiang]."联系人:".$data[0][contact_user]."/".$data[0][contact_tel]."; 详细信息：http://www.taochele.com/buy/view/cid/".$cid.";【淘车乐】信息编号:".$cid;
        
        $this->view->img = $core->getErweima($chl);
        
        
    }
	
    //车源信息 虚假 举报
    public function jubaoAction() {
        $cid = intval($this->_request->getParam('cid'));
        
    }
    
    //成功弹窗
    public function successAction() {
        $res = urldecode($this->_request->getParam('res'));
        $url = urldecode($this->_request->getParam('url'));
        
        
        $this->view->res = $res;
        $this->view->url = $url;
    }
    
    
    //登陆
    public function loginAction() {
    	
        
        $ref = urldecode($this->_request->getParam('ref'));
        $isre = trim($this->_request->getParam('isre'));
        $this->view->isre = $isre;
        
        if ($ref){
            $this->view->ref = $ref;
        }else{
            $this->view->ref = "http://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
        }
    }

    //登出
    public function loginoutAction() {
    
        $ref = urldecode($this->_request->getParam('ref'));
        $core = new Model_Core();
        if ($core->unsetLogin()){
            echo "<script type=\"text/javascript\">successMsg(\"您已安全退出,正在跳转...\", \"$ref\");</script>";
        }else{
            echo "<script type=\"text/javascript\">errorMsg(\"系统错误,请重试!\")</script>";
        }
    }
    
    //WEINXIN
    public function weixinAction() {
    	
    }
    
    
    
}

